##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## R code to install the SPDDD package for
##  "Every Story Has a Beginning, Middle, and an End (But Not Always in That Order): 
##   Predicting duration dynamics in a unified framework"
##
##  Authors: Daina Chiba, Nils W. Metternich, and Michael D. Ward
##
##  Last modified: 2014-08-23
##  Contact Daina Chiba (daina.chiba@gmail.com) for any questions.
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# This R code script installs R packages necessary to implement the following R code scripts:
#
# 1_DescriptiveStats.R
# 2_MonteCarlo.R
# 3_Analyses.R

# > sessionInfo()
# R version 3.1.1 (2014-07-10)
# Platform: x86_64-apple-darwin13.1.0 (64-bit)

## Set the working directory if necessary

# setwd("your_path_to_the_folder")


## Install required packages

install.packages("corpcor", dependencies = TRUE)
install.packages("ggplot2", dependencies = TRUE)
install.packages("grid", dependencies = TRUE)
install.packages("mvtnorm", dependencies = TRUE)

## Install our SPDDD package

install.packages("SPDDD_0.14.tar.gz", repos=NULL, type='source')

## You might need the .zip version below instead if you are on a Windows machine
# install.packages("SPDDD_0.14.zip", repos=NULL, type='source')

# End of file -------------------------------------------------------------
